<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<style>
th { font-weight:normal; padding:5px 0 5px 0;}
</style>
<form action="?m=ushop&c=bonus&a=bonus_orderby&type=1&menuid=<?php echo $_GET['menuid'];?>" method="post" id="sale_form">
<div class="table-list" style="width:99%; margin:auto;">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th width="10%" align="center">ID&nbsp;</th>
			<th width="40%" align="center">商品名称&nbsp;</th>
            <th width='30%' align="center">更新时间&nbsp;</th>
            <th width="20%" align="center">操作</th>
		</tr>
	</thead>
<tbody>
<?php
if(is_array($goods_info) && !empty($goods_info)){
	foreach($goods_info as $info){
?>
	<tr>
        <th align="center"><input type="checkbox" name="id[]" value="<?php echo $info['id']?>"></th>
        <th align="center"><?php echo $info['title'] ?></th>
        <th align="center"><?php echo date('Y-m-d H:m:s',$info['updatetime']) ?></th>
        <th align="center"><a href="?m=ushop&c=bonus&a=goods_delete&id=<?php echo $info['id']; ?>&bonusid=<?php echo $_GET['mid']; ?>&bonus_id=<?php echo $info['bonus_id']?>">移除</a></th>
	</tr>
<?php
	}
}else if(empty($infos)) {
?>
	<tr>
    	<td colspan="7" align="center">没有找到任何记录</td>
    </tr>
<?php	
}
?>
</tbody>
</table>
</div>
<div class="btn">
    <a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('selected_all')?></a>/
    <a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a>
    <input name="dosubmit" type="submit" class="button" value="删除选中" onclick="return confirm('<?php echo L('confirm', array('message' => L('selected')))?>');">&nbsp;&nbsp;
</div>
<div id="pages"><?php echo $pages?></div>
</form>
<script>
	$("input[value='删除选中']").live('mousedown',function() {
		document.getElementById("sale_form").action = "?m=ushop&c=bonus&a=bonus_delete";
	})
	function send_email(id,member) {
		$.get('http://www.eshop.com/index.php?m=ushop&c=bonus&a=public_send_email&mid='+id+'&member='+member,function() {alert('发送成功')});
	}
	function alse_sort(sort_by,sort_order) {
		document.getElementById('sale_order').value = sort_by+'&'+sort_order;
		document.getElementById('sale_form').submit();
	}
	function alse_sorttype(sort_by) {
		document.getElementById('orderby_member').value = sort_by;
		document.getElementById('sale_form').submit();
	}
</script>
</body>
</html>